package com.my12306.user.model.po;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.Objects;

/**
 * @Author:苏牧夕
 * @Date:2020/6/19 19:05
 * @Version 1.0
 */
@TableName("p_follow")
public class FollowEntity {
    /**
     * id主键
     */
    @TableId
    private Long id;
    /**
     * 关注人id
     */
    @NotNull
    private Long fansId;
    /**
     * 被关注人id
     */
    @NotNull
    private Long masterId;
    /**
     * 显示状态 0-表示禁用 1-表示正常
     */
    private Integer showStatus;
    /**
     * 逻辑删除 0-表示删除，1-表示正常
     */
    private Integer logicDelete;
    /**
     * 注册时间
     */
    private Date createDate;
    /**
     * 修改时间
     */
    private Date updateDate;
    /**
     * 版本号
     */
    private Integer version;

    public FollowEntity() {
    }

    public FollowEntity(Long id, Long fansId, Long masterId, Integer showStatus, Integer logicDelete, Date createDate, Date updateDate, Integer version) {
        this.id = id;
        this.fansId = fansId;
        this.masterId = masterId;
        this.showStatus = showStatus;
        this.logicDelete = logicDelete;
        this.createDate = createDate;
        this.updateDate = updateDate;
        this.version = version;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof FollowEntity)) return false;
        FollowEntity that = (FollowEntity) o;
        return Objects.equals(getId(), that.getId()) &&
                Objects.equals(getFansId(), that.getFansId()) &&
                Objects.equals(getMasterId(), that.getMasterId()) &&
                Objects.equals(getShowStatus(), that.getShowStatus()) &&
                Objects.equals(getLogicDelete(), that.getLogicDelete()) &&
                Objects.equals(getCreateDate(), that.getCreateDate()) &&
                Objects.equals(getUpdateDate(), that.getUpdateDate()) &&
                Objects.equals(getVersion(), that.getVersion());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getFansId(), getMasterId(), getShowStatus(), getLogicDelete(), getCreateDate(), getUpdateDate(), getVersion());
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getFansId() {
        return fansId;
    }

    public void setFansId(Long fansId) {
        this.fansId = fansId;
    }

    public Long getMasterId() {
        return masterId;
    }

    public void setMasterId(Long masterId) {
        this.masterId = masterId;
    }

    public Integer getShowStatus() {
        return showStatus;
    }

    public void setShowStatus(Integer showStatus) {
        this.showStatus = showStatus;
    }

    public Integer getLogicDelete() {
        return logicDelete;
    }

    public void setLogicDelete(Integer logicDelete) {
        this.logicDelete = logicDelete;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }
}
